package com.rcpcompany.ui.flows;

import org.eclipse.swt.graphics.Image;

/**
 * Abstract base class for all {@link IFlowDirector flow directors}.
 * <p>
 * Currently more or less empty, but here to allow for future changes without
 * too many changes in the base classes.
 * 
 * @author Tonny Madsen, The RCP Company
 */
public abstract class AbstractFlowDirector implements IFlowDirector {

	/**
	 * The title of this director if the same all the time
	 */
	private final String myTitle;

	/**
	 * Constructs and returns a new director with the specified title.
	 * 
	 * @param title
	 *            the title
	 */
	public AbstractFlowDirector(String title) {
		myTitle = title;
	}

	/**
	 * Constructs and returns a new director with no title.
	 * <p>
	 * Remember to override {@link #getTitle()}.
	 */
	public AbstractFlowDirector() {
		this(null);
	}

	public Image getImage() {
		return null;
	}

	public String getTitle() {
		return myTitle;
	}

	public void dispose() {
	}

	private IFlowContainer myContainer;

	public void open(IFlowContainer container) {
		myContainer = container;
	}

	public IFlowContainer getContainer() {
		return myContainer;
	}

	public void updateState() {
		// Default empty version
	};

	/**
	 * By default all buttons are used
	 */
	public boolean isNavigationButtonWanted(WhereTo where) {
		return true;
	}
}
